package weiy.top.modules.attr.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import weiy.top.modules.attr.entity.PmsAttrGroup;
import weiy.top.modules.attr.mapper.PmsAttrGroupMapper;
import weiy.top.modules.attr.service.IPmsAttrGroupService;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import weiy.top.modules.category.service.IPmsCategoryService;

/**
 * @Description: pms_attr_group
 * @Author: weihancheng
 * @Date:   2021-11-24
 * @Version: V1.0
 */
@Service
public class PmsAttrGroupServiceImpl extends ServiceImpl<PmsAttrGroupMapper, PmsAttrGroup> implements IPmsAttrGroupService {

    @Autowired
    private IPmsCategoryService categoryService;


    @Override
    public PmsAttrGroup getByIdMain(String id) {
        PmsAttrGroup entity = getById(id);
        String catelogId = entity.getCatelogId();
        String[] path = categoryService.getCatelogPathByCatelogId(catelogId);
        entity.setCatelogPath(path);
        return entity;
    }
}
